package com.example.yilanchatserver.business.freechat.service.impl;

import org.springframework.data.redis.connection.RedisConnection;
import org.springframework.data.redis.core.StringRedisTemplate;

public class SelectableRedisTemplate extends StringRedisTemplate {



    @Override
    public RedisConnection createRedisConnectionProxy(RedisConnection pm) {
        return super.createRedisConnectionProxy(pm);
    }


    @Override
    public RedisConnection preProcessConnection(RedisConnection connection, boolean existingConnection) {
        Integer db;
        if ((db = RedisSelectSupport.getSelect()) != null)
            connection.select(db.intValue());
        return super.preProcessConnection(connection, existingConnection);
    }
}
